home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 March
/
PCWorld_2007-03_cd.bin
/
komunikace
/
acehtml
/
acehtmlfreeware.exe
/
scriptdef
/
Context Menu.sd
< prev
next >
Wrap
INI File
|
2006-09-13
|
4KB
|
153 lines
[SUBJECT]
Description=Context menu Script
ImageIndex=1
Folder=Menus
[HEAD_TEXT]
;<!--
;
;Developer's notes: This script employs two IE 5 techniques to create the context menu.
;First, we used the new conditional HTML comment of IE 5 to make the menu degrade perfectly
;with all browsers. Noticed the "strange" comment tag around the <div>- that's conditional
;comment that makes the <div> appear only in IE 5! Secondly, we used
;the new document. oncontextmenu event handler of IE 5 to detect and overide the default
;window's context menu when the surfer right clicks her mouse, and substitute it with our
;own instead. Everything else in the code is basic DHTML.
;
;-->
;<style>
;<!--
;/*
;Context menu Script-
;⌐ Dynamic Drive (www.dynamicdrive.com)
;Last updated: 99/09/16th
;For full source code, 100's more DHTML scripts, and Terms Of Use,
;visit dynamicdrive.com
;*/
;
;#ie5menu{
;position:absolute;
;width:200px;
;border:2px solid black;
;background-color:menu;
;font-family:Verdana;
;line-height:20px;
;cursor:default;
;visibility:hidden;
;}
;
;.menuitems{
;padding-left:15px;
;padding-right:15px;
;}
;-->
;</style>
;
;<script language="JavaScript1.2">
;//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
;var display_url=0;
;
;
;function showmenuie5(){
;//Find out how close the mouse is to the corner of the window
;var rightedge=document.body.clientWidth-event.clientX;
;var bottomedge=document.body.clientHeight-event.clientY;
;
;//if the horizontal distance isn't enough to accomodate the width of the context menu
;if (rightedge<ie5menu.offsetWidth)
;//move the horizontal position of the menu to the left by it's width
;ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth;
;if (rightedge >= ie5menu.offsetWidth)
;//position the horizontal position of the menu where the mouse was clicked
;ie5menu.style.left=document.body.scrollLeft+event.clientX;
;
;//same concept with the vertical position
;if (bottomedge<ie5menu.offsetHeight)
;ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight;
;else
;ie5menu.style.top=document.body.scrollTop+event.clientY;
;
;ie5menu.style.visibility="visible";
;return false;
;}
;
;function hidemenuie5(){
;ie5menu.style.visibility="hidden";
;}
;
;function highlightie5(){
;if (event.srcElement.className=="menuitems"){
;event.srcElement.style.backgroundColor="highlight";
;event.srcElement.style.color="white";
;if (display_url==1)
;window.status=event.srcElement.url;
;}
;}
;
;function lowlightie5(){
;if (event.srcElement.className=="menuitems"){
;event.srcElement.style.backgroundColor="";
;event.srcElement.style.color="black";
;window.status='';
;}
;}
;
;function jumptoie5(){
;if (event.srcElement.className=="menuitems")
;window.location=event.srcElement.url;
;}
;</script>
;
[BODY_TEXT]
;<!--[if IE]>
;<div id="ie5menu" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
;<div class="menuitems" url="`link0`">`caption0`</div>
;
#insert point for macro text
;<hr>
;<div class="menuitems" url="mailto:dynamicdrive@yahoo.com">Email Us</div>
;</div>
;<![endif]-->
;<script language="JavaScript1.2">
;document.oncontextmenu=showmenuie5;
;if (document.all&&window.print)
;document.body.onclick=hidemenuie5;
;</script>
[MACRO_ITEM]
;<div class="menuitems" url="`link`">`caption`</div>
;
[`caption`]
Kind=S
Value=Caption
[`caption0`]
Kind=S
Value=Dynamicdrive.com
[`link`]
Kind=U
Value=URL
[`link0`]
Kind=U
Value=http://dynamicdrive.com